﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;

namespace prog_tech_5
{
    class MusicList
    {
        private ArrayList _tracks;
        public MusicList()
        {
            _tracks = new ArrayList();
        }
        public ArrayList tracks()
        {
            return _tracks;
        }
        public void AddTrack(AudioRecord rec)
        {
            _tracks.Add(rec);
        }
        public void RemoveTrack(int ind)
        {
            _tracks.RemoveAt(ind);
        }
        public int GetLength()
        {
            return _tracks.Count;
        }
        public double CalculateTime()
        {
            double res = 0.0;
            foreach (AudioRecord rec in _tracks)
            {
                res += rec.length();
            }
            return res;
        }
        public void clearList()
        {
            _tracks.Clear();
        }
    }
}
